package com.ruoyi.source.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.SourceDataCallbackLogMapper;
import com.ruoyi.db.domain.SourceDataCallbackLog;
import com.ruoyi.source.service.ISourceDataCallbackLogService;

/**
 * 线索回调日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-28
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class SourceDataCallbackLogServiceImpl implements ISourceDataCallbackLogService 
{
    @Autowired
    private SourceDataCallbackLogMapper sourceDataCallbackLogMapper;

    /**
     * 查询线索回调日志
     * 
     * @param id 线索回调日志主键
     * @return 线索回调日志
     */
    @Override
    public SourceDataCallbackLog selectSourceDataCallbackLogById(Long id)
    {
        return sourceDataCallbackLogMapper.selectSourceDataCallbackLogById(id);
    }

    /**
     * 查询线索回调日志列表
     * 
     * @param sourceDataCallbackLog 线索回调日志
     * @return 线索回调日志
     */
    @Override
    public List<SourceDataCallbackLog> selectSourceDataCallbackLogList(SourceDataCallbackLog sourceDataCallbackLog)
    {
        return sourceDataCallbackLogMapper.selectSourceDataCallbackLogList(sourceDataCallbackLog);
    }

    /**
     * 查询线索回调日志列表
     *
     * @param sourceDataCallbackLog 线索回调日志
     * @return 线索回调日志
     */
    @Override
    public List<Map<String, Object>> selectSourceDataCallbackLogMapList(SourceDataCallbackLog sourceDataCallbackLog)
    {
        return sourceDataCallbackLogMapper.selectSourceDataCallbackLogMapList(sourceDataCallbackLog);
    }

    /**
     * 新增线索回调日志
     * 
     * @param sourceDataCallbackLog 线索回调日志
     * @return 结果
     */
    @Override
    public int insertSourceDataCallbackLog(SourceDataCallbackLog sourceDataCallbackLog)
    {
        sourceDataCallbackLog.setCreateTime(DateUtils.getNowDate());
        return sourceDataCallbackLogMapper.insertSourceDataCallbackLog(sourceDataCallbackLog);
    }

    /**
     * 修改线索回调日志
     * 
     * @param sourceDataCallbackLog 线索回调日志
     * @return 结果
     */
    @Override
    public int updateSourceDataCallbackLog(SourceDataCallbackLog sourceDataCallbackLog)
    {
        sourceDataCallbackLog.setUpdateTime(DateUtils.getNowDate());
        return sourceDataCallbackLogMapper.updateSourceDataCallbackLog(sourceDataCallbackLog);
    }

    /**
     * 批量删除线索回调日志
     * 
     * @param ids 需要删除的线索回调日志主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataCallbackLogByIds(Long[] ids)
    {
        return sourceDataCallbackLogMapper.deleteSourceDataCallbackLogByIds(ids);
    }

    /**
     * 删除线索回调日志信息
     * 
     * @param id 线索回调日志主键
     * @return 结果
     */
    @Override
    public int deleteSourceDataCallbackLogById(Long id)
    {
        return sourceDataCallbackLogMapper.deleteSourceDataCallbackLogById(id);
    }
}
